<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>无标题文档</title>
        <script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/lan.js}"></script>
        <script language="javascript" type="text/javascript">
		 </script>
        <link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
        <style>
            label.error {color:red;}
			.tab-frame td {padding:5px 2px; text-align:left;}
			.tab-search td {padding:2px 5px;}
			.tab-frame td.right {text-align:right;}
			.tab-frame td.center {text-align:center;}
        </style>
    </head>
    <body>
        <div class="sub-body">
	<h3 class="title-1 tab-frame"><!--{if $factorys}-->工厂订单统计<!--{elseif $merchandisers}-->跟单订单统计<!--{elseif $userqc}-->QC订单统计<!--{else}-->{$factory.factory_name}&nbsp;订单统计<!--{/if}--></h3>
		<div id="head">
            <a href="javascript:;" onclick="$('#search').slideToggle();">收起/展开</a>
            <div  id="search">
                <div class="tab-frame-s">
                <form action="index.php" method="get">
                        	<input type="hidden" name="app" value="default" />
                            <input type="hidden" name="act" value="order_count" />
                            <!-- {if $merchandiser} -->
                            <input type="hidden" name="merchandiser" value="{$merchandiser}" />
                            <!-- {/if} -->
                            <!-- {if $userqc} -->
                            <input type="hidden" name="userqc" value="{$userqc}" />
                            <!-- {/if} -->
                    <table width="900" cellspacing="0" cellpadding="0" class="search" >
                    <tr>
                    	<th width="100" class="right">订单状态：</th>
                        <td width="200"><select name="status" id="status">
                                        <option value="0">全部</option>
                                    <!--{foreach from=$lang.order_status item=os key=k}-->
                                    	<!-- {if $k!=5} -->
                                        <option value="{$k}"{if $smarty.get.status == $k} selected{/if}>{$os}</option>
                                        <!-- {/if} -->
                                    <!--{/foreach}-->
                                    </select></td>
                         <th width="100" class="right">年：</th>
                         <td><select name="year" id="year">
                                <option value="0">全部</option>
                                <!--{foreach from=$years item=year}-->
                                <option value="{$year}"{if $this_year == $year} selected{/if}>{$year}</option>
                                <!--{/foreach}-->
                            </select></td>
						<td><input type="hidden" name="order" id="order" value="{if $smarty.get.order}{$smarty.get.order}{else}order_create_date-DESC{/if}" />
                        	<input type="submit" name="search" value="查询" class="btn-2" /></td>
                    </tr>
                </table>
                    </form>
                </div>
                <script>
                    <!--{if $role==USER_MERCHANDISER}-->
                       //$('#brand_id').attr('disabled','disabled');
                       //$('#buyer_id').attr('disabled','disabled');
                       $('#merchandiser_id option:first-child').remove();
                       $('#merchandiser_id').val('{$user.user_id}');
                       $('#merchandiser_id').attr('readonly','readonly');
                    <!--{/if}-->
                </script>
            </div>
            </div>
            <div class="Create" style="margin-top: 10px;">
                <input type="button" class="btn-2" value="工厂订单统计" onclick="location.href='index.php?app=default&act=order_count'"/>
                <!-- {if $merch_admin || $is_manager} -->
                <input type="button" class="btn-2" value="跟单订单统计" onclick="location.href='index.php?app=default&act=order_count&merchandiser=1'"/>
				<!-- {/if} -->
				<!-- {if $qc_admin || $is_manager} -->
				<input type="button" class="btn-2" value="QC订单统计" onclick="location.href='index.php?app=default&act=order_count&userqc=1'"/>
				<!-- {/if} -->
            </div>
            <div class="tab_info" id="order_list">
                <div class="tab-title-1"><span>统计信息</span></div>
                <table width="100%" cellspacing="0" cellpadding="0" class="tab-display" id="tab-color">
				<!--{if $factorys}-->
                    <tr>
                        <th width="">工厂</th>
                        <th width="80">订单数</th>
                        <th width="80">件数</th>
                        <th width="60">1</th>
                        <th width="60">2</th>
                        <th width="60">3</th>
                        <th width="60">4</th>
                        <th width="60">5</th>
                        <th width="60">6</th>
                        <th width="60">7</th>
                        <th width="60">8</th>
                        <th width="60">9</th>
                        <th width="60">10</th>
                        <th width="60">11</th>
                        <th width="60">12</th>
                    </tr>
                    <!--{foreach from=$factorys item=factory}-->
                    <tr>
                        <td>{$factory.factory_name}({$factory.factory_goods_num|default:0})</td>
                        <td><a href="{url app=default&act=order_count&factory_id=$factory.factory_id&year=$this_year&status=$smarty.get.status}" style="color:#0066FF;">{$factory.order_count}</a></td>
						<!--{foreach from=$factory.quantitys item=quantity key=k}-->
                        <td><!--{if $quantity}-->{$quantity}<!--{else}-->0<!--{/if}--></td>
						<!--{/foreach}-->
                    </tr>
                    <!--{/foreach}-->
				<!--{elseif $merchandisers}-->
				<!-- {if $merch_admin || $is_manager} -->
                    <tr>
                        <th width="">跟单</th>
                        <th width="80">订单数</th>
                        <th width="80">件数</th>
                        <th width="60">1</th>
                        <th width="60">2</th>
                        <th width="60">3</th>
                        <th width="60">4</th>
                        <th width="60">5</th>
                        <th width="60">6</th>
                        <th width="60">7</th>
                        <th width="60">8</th>
                        <th width="60">9</th>
                        <th width="60">10</th>
                        <th width="60">11</th>
                        <th width="60">12</th>
                    </tr>
                    <!--{foreach from=$merchandisers item=user}-->
                    <tr>
                        <td>{$user.user_name}</td>
                        <td>{$user.order_count}</td>
						<!--{foreach from=$user.quantitys item=quantity key=k}-->
                        <td><!--{if $quantity}--><!-- {if $k==0} -->{$quantity}<!-- {else} --><a href="{url app=order&act=search&year=$this_year&month=$k&merchandiser_id=$user.user_id&status=$status}">{$quantity}</a><!-- {/if} --><!--{else}-->0<!--{/if}--></td>
						<!--{/foreach}-->
                    </tr>
                    <!--{/foreach}-->
                    <!-- {/if} -->
                <!-- {elseif $userqc} -->
                <!-- {if $qc_admin || $is_manager} -->
                	<tr>
                        <th width="">QC</th>
                        <th width="80">订单数</th>
                        <th width="80">件数</th>
                        <th width="60">1</th>
                        <th width="60">2</th>
                        <th width="60">3</th>
                        <th width="60">4</th>
                        <th width="60">5</th>
                        <th width="60">6</th>
                        <th width="60">7</th>
                        <th width="60">8</th>
                        <th width="60">9</th>
                        <th width="60">10</th>
                        <th width="60">11</th>
                        <th width="60">12</th>
                    </tr>
                    <!--{foreach from=$qc_list item=qcs}-->
                    <tr>
                        <td>{$qcs.user_name}</td>
                        <td><a href="{url app=default&act=order_count&qc_id=$qcs.user_id&year=$this_year&status=$smarty.get.status}" style="color:#0066FF;">{$qcs.order_count}</a></td>
						<!--{foreach from=$qcs.quantitys item=quantity key=k}-->
                        <td><!--{if $quantity}-->{$quantity}<!--{else}-->0<!--{/if}--></td>
						<!--{/foreach}-->
                    </tr>
                    <!--{/foreach}-->
                    <!-- {/if} -->
				<!--{else}-->
                    <tr>
                        <th><!-- {if $is_qc} -->QC<!-- {else} -->工厂<!-- {/if} --></th>
                        <td colspan="17"><!-- {if $is_qc} -->{$factory.user_name}<!-- {else} -->{$factory.factory_name}<!-- {/if} --></td>
                    </tr>
                    <tr>
                        <th width="60">品牌</th>
                        <th width="60">订单号</th>
                        <th width="60">款号</th>
						<th width="50">件数</th>
                        <th width="60">跟单</th>
                        <th width="60">工厂</th>
                        <th width="60">1</th>
                        <th width="60">2</th>
                        <th width="60">3</th>
                        <th width="60">4</th>
                        <th width="60">5</th>
                        <th width="60">6</th>
                        <th width="60">7</th>
                        <th width="60">8</th>
                        <th width="60">9</th>
                        <th width="60">10</th>
                        <th width="60">11</th>
                        <th width="60">12</th>
                    </tr>
                    <!--{foreach from=$factory.orders item=order}-->
                    <tr{if $order.status == 1} style="color:#cd00ff;"{/if}>
                        <td>{$order.brand_name}</td>
                        <td><a href="{url app=order&act=edit&id=$order.order_id}">{$order.order_sn}</a></td>
                        <td>{$order.style_sn}</td>
                        <td>{$order.quantity}</td>
                        <td>{$order.merchandiser}</td>
                        <td>{$order.factory_name}</td>
						<!--{foreach from=$order.months item=month}-->
						<td>{$month}</td>
						<!--{/foreach}-->
                    </tr>
                    <!--{/foreach}-->
				<!--{/if}-->
                </table>
                <div class="page">
                  {include file=page.html}</div>
            </div>
            <script language="JavaScript">
                function create_order(){
                   location.href='index.php?app=order&act=add';
                    return;
                   $('#head').hide();
                    $('#order_list').hide();
                    $('#order_info').hide().load('{$siteurl}/index.php?app=order&act=add','',function(){
                        $.get('{$siteurl}/index.php?app=order&act=add',function(data){
                            $('#order_info').html(data);
                        });
                      $('#order_info').fadeIn('slow');});
                }
                
            </script>


            <div id="order_info">
                
            
            </div>
        </div>
<script language="javascript" type="text/javascript" src="{res file=js/tab_color.js}"></script>
    </body>
</html>

